#ifndef WORKSPACE_H
#define WORKSPACE_H

#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QList>
#include <gsplot.h>
#include <gsplotcontrol.h>

class WorkSpace : public QWidget
{
    Q_OBJECT
    Q_ENUMS(LayoutSet)

public:
    explicit WorkSpace(QWidget *parent = 0);
    ~WorkSpace();    

    enum LayoutSet { HBOX, VBOX }; // Plot Files Layout Mode    
    void newPlot(QList<GSData*>* dataSet);
    void removePlot(const int index);
    void movePlotForward(const int index);
    void movePlotBackward(const int index);
    void updatePlotLayout();
    LayoutSet getLayoutSet();

public slots:
    void setLayoutMode(LayoutSet layout);
    void layoutChange();
    void editPlot(GSPlot* gsp, GSPlotControl::CtlType type);

public:
    QString name;        //WorkSpace name
    QString comments;    //Comments about this WorkSpace

private:
    LayoutSet layoutSetPara; // Select Layout Mode
    QVBoxLayout* vboxLayout = NULL;
    QHBoxLayout* hboxLayout = NULL;

    QList<GSPlot*> plot; //Plot Files in this WorkSpace
    QList<GSPlotControl*> plotControl; //Plot Files in this WorkSpace
};

#endif // WORKSPACE_H
